home *** CD-ROM | disk | FTP | other *** search
/ Openstep 4.2 (Developer) / Openstep Developer 4.2.iso / NextDeveloper / Makefiles / pb_makefiles / implicitrules.make < prev    next >
Encoding:
Text File  |  1997-01-11  |  3.4 KB  |  133 lines

  1. #
  2. # implicitrules.make
  3. #
  4. # Implicit rules for generating and compiling source code.
  5. #
  6. # IMPORTED VARIABLES
  7. #   All of the commands exported by commands-*.make
  8. #   All of the flags exported by flags.make
  9. #
  10.  
  11. #
  12. # eliminate all the default suffixes
  13. #
  14.  
  15. .SUFFIXES:
  16.  
  17. #
  18. # compiling
  19. #
  20.  
  21. .SUFFIXES: .o .h .c .m .cc .cxx .C .mm .mxx .M .s
  22.  
  23. .c.o:
  24.     $(CC) $(ALL_CFLAGS) -c -o $(OFILE_DIR)/$*.o $<
  25.  
  26. .m.o:
  27.     $(CC) $(ALL_MFLAGS) -c -o $(OFILE_DIR)/$*.o $<
  28.  
  29. .cc.o .C.o .cxx.o .cpp.o:
  30.     $(CC) $(ALL_CCFLAGS) -c -o $(OFILE_DIR)/$*.o $<
  31.  
  32. .M.o:
  33. ifneq "YES" "$(DISABLE_OBJCPLUSPLUS)"
  34.     $(CC) $(ALL_MMFLAGS) -c -o $(OFILE_DIR)/$*.o $<
  35. else
  36.     $(SILENT) $(ECHO) Sorry, Objective-C++ compilation of $*.M not supported.
  37.     $(TOUCH) $(SFILE_DIR)/$*.m
  38.     $(CC) -c $(SFILE_DIR)/$*.m -o $(OFILE_DIR)/$*.o
  39.     $(RM) -f $(SFILE_DIR)/$*.m
  40. endif
  41.  
  42. .s.o:
  43.     $(CC) $(ALL_CFLAGS) -c -o $(OFILE_DIR)/$*.o $<
  44.  
  45. #
  46. # pswraps
  47. #
  48.  
  49. .SUFFIXES: .psw .pswm .h .c .m
  50.  
  51. .psw.h: 
  52.     $(PSWRAP) $(ALL_PSWFLAGS) -a -h $(SFILE_DIR)/$*.h -o $(SFILE_DIR)/$*.c $<
  53. .psw.c:
  54.     $(PSWRAP) $(ALL_PSWFLAGS) -a -h $(SFILE_DIR)/$*.h -o $(SFILE_DIR)/$*.c $<
  55. .pswm.h:
  56.     $(PSWRAP) $(ALL_PSWFLAGS) -a -h $(SFILE_DIR)/$*.h -o $(SFILE_DIR)/$*.m $<
  57. .pswm.m:
  58.     $(PSWRAP) $(ALL_PSWFLAGS) -a -h $(SFILE_DIR)/$*.h -o $(SFILE_DIR)/$*.m $<
  59.  
  60. #
  61. # Yacc and Lex
  62. #
  63.  
  64. .SUFFIXES: .y .l .h .c
  65.  
  66. .y.c .y.h:
  67.     $(CD) $(SFILE_DIR) && $(YACC) $(ALL_YFLAGS) $(shell pwd)/$<
  68.     $(CP) $(SFILE_DIR)/y.tab.h $(SFILE_DIR)/$*.h
  69.     $(MV) $(SFILE_DIR)/y.tab.c $(SFILE_DIR)/$*.c
  70.  
  71. .ym.m .ym.h:
  72.     $(CD) $(SFILE_DIR) && $(YACC) $(ALL_YFLAGS) $(shell pwd)/$<
  73.     $(CP) $(SFILE_DIR)/y.tab.h $(SFILE_DIR)/$*.h
  74.     $(MV) $(SFILE_DIR)/y.tab.c $(SFILE_DIR)/$*.m
  75.  
  76. .l.c:
  77.     $(CD) $(SFILE_DIR) && $(LEX) $(ALL_LFLAGS) $(shell pwd)/$<
  78.     $(MV) $(SFILE_DIR)/lex.yy.c $(SFILE_DIR)/$*.c
  79.  
  80. .lm.m:
  81.     $(CD) $(SFILE_DIR) && $(LEX) $(ALL_LFLAGS) $(shell pwd)/$<
  82.     $(MV) $(SFILE_DIR)/lex.yy.c $(SFILE_DIR)/$*.m
  83.  
  84. #
  85. # Precompiled headers
  86. #
  87.  
  88. .SUFFIXES: .h .p
  89.  
  90. .h.p:
  91.     -$(CC) $(ALL_PRECOMPFLAGS) $*.h -o $*.p
  92.     $(SILENT) if [ -n "$(findstring $@, $(PUBLIC_HEADERS))" ] ; then \
  93.        cmd="cd $(PUBLIC_HDR_DIR)$(PUBLIC_HEADER_DIR_SUFFIX) && $(CC) $(ALL_PRECOMPFLAGS) $*.h -o $*.p" ; $(ECHO) $$cmd ; eval $$cmd ; \
  94.     fi
  95.     $(SILENT) if [ -n "$(findstring $@, $(PRIVATE_HEADERS))" ] ; then \
  96.        cmd="cd $(PRIVATE_HDR_DIR)$(PRIVATE_HEADER_DIR_SUFFIX) && $(CC) $(ALL_PRECOMPFLAGS) $*.h -o $*.p" ; $(ECHO) $$cmd ; eval $$cmd ; \
  97.     fi
  98.     $(SILENT) if [ -n "$(findstring $@, $(PROJECT_HEADERS))" ] ; then \
  99.        cmd="cd $(PROJECT_HDR_DIR)$(PROJECT_HEADER_DIR_SUFFIX) && $(CC) $(ALL_PRECOMPFLAGS) $*.h -o $*.p" ; $(ECHO) $$cmd ; eval $$cmd ; \
  100.     fi
  101.         # Note that because precomps must go in the same directory as the .h
  102.         # we may not be able to write the precomp in the local case, so use a '-'
  103.  
  104. #
  105. # mig, msgwrap, and rpcgen
  106. #
  107.  
  108. ifneq "" "$(MIG)"
  109. %.h %Server.c %User.c: %.defs
  110.     $(CD) $(SFILE_DIR) && $(MIG) $(ALL_MIGFLAGS) $(shell pwd)/$<
  111. %.h %Server.c %User.c: %.mig
  112.     $(CD) $(SFILE_DIR) && $(MIG) $(ALL_MIGFLAGS) $(shell pwd)/$<
  113. else
  114. %.h: %.h.mig
  115.     $(CP) $< $(SFILE_DIR)/$@
  116. %User.c: %User.c.mig
  117.     $(CP) $< $(SFILE_DIR)/$@
  118. %Server.c: %Server.c.mig
  119.     $(CP) $< $(SFILE_DIR)/$@
  120. endif
  121.  
  122. %Speaker.h %Speaker.m %Listener.h %Listener.m: %.msg
  123.     $(CD) $(SFILE_DIR) && $(MSGWRAP) $(shell pwd)/$<
  124.  
  125. %.h: %.x
  126.     $(RPCGEN) $(ALL_RPCFLAGS) -h -o $(SYM_DIR)/$*.h $*.x
  127. %.c: %.x_svc
  128.     $(RPCGEN) $(ALL_RPCFLAGS) -s udp -s tcp -o $(SYM_DIR)/$*_svc.c $*.x
  129. %.c: %.x_clnt
  130.     $(RPCGEN) $(ALL_RPCFLAGS) -l -o $(SYM_DIR)/$*_clnt.c $*.x
  131. %.c: %.x_xdr
  132.     $(RPCGEN) $(ALL_RPCFLAGS) -c -o $(SYM_DIR)/$*_xdr.c $*.x
  133.